package com.vrms.app.service.impl;


import com.vrms.app.dao.FloorDao;
import com.vrms.app.entity.Floor;
import com.vrms.app.service.FloorService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class FloorServiceImpl implements FloorService {
    @Resource
    private FloorDao floorDao;

    @Override
    public List<Floor> listPage(int page, int size, String buildingNo) {
        return floorDao.listPage((page-1)*size,size,buildingNo);
    }

    @Override
    public int count(String buildingNo) {
        return floorDao.count(buildingNo);
    }

    @Override
    public boolean save(Floor floor) {
        return floorDao.save(floor)>0;
    }

    @Override
    public boolean remove(int id) {
        return floorDao.remove(id)>0;
    }

    @Override
    public List<Floor> list() {
        return floorDao.list();
    }
}
